r = 1 gotkey = 1 demon = 1 SCREEN 12 COLOR 7, 0 CLS DIM SHARED DOOM AS DOUBLE Minutes = 10 Seconds = 0 GameTime = Minutes * 60 + Seconds DIM directions(1 TO 9) AS STRING directions(1) = "EAST" directions(2) = "WEST OR SOUTH" directions(3) = "NORTH OR EAST" directions(4) = "EAST OR WEST" directions(5) = "WEST OR SOUTH" directions(6) = "NORTH, SOUTH, OR WEST" directions(7) = "NORTH" directions(8) = "EAST OR SOUTH" directions(9) = "NORTH" PRINT "" PRINT "" PRINT "A dark night, a world engulfed in shadows, and a lurking beast. That feeds" PRINT "on those who are foolish enough to stay out late. This is what you get when" PRINT "you stay out at late hours. You can recall the stories you were told, the" PRINT "demon that lurked at night, waiting, hungry. But those were all made up..." PRINT "right?" PRINT "" DO: LOOP UNTIL INKEY$ <> "" DOOM = TIMER(0.001) + GameTime 'change this to to desied time for the game to run DO CLS PRINT PRINT PRINT " " PRINT " " PRINT " " PRINT " The Lurking Beast " PRINT " " PRINT " Written by " PRINT " " PRINT " D.B. Taylor" PRINT "" PRINT " Copyright (c) 2016" PRINT "" PRINT SPACE$(38); IF INSTR(directions(r), "NORTH") THEN PRINT "N" ELSE PRINT PRINT "*---------------------------------* "; IF INSTR(directions(r), "WEST") THEN PRINT "W"; ELSE PRINT " "; PRINT " + "; IF INSTR(directions(r), "EAST") THEN PRINT "E"; ELSE PRINT " "; PRINT " *------------------------------------*" PRINT SPACE$(38); IF INSTR(directions(r), "SOUTH") THEN PRINT "S" ELSE PRINT PRINT PRINT "If you are stuck just type HELP." PRINT GOSUB ROOM GOSUB parser LOOP ROOM: IF r = 1 THEN: GOSUB r1 IF r = 2 THEN: GOSUB r2 IF r = 3 THEN: GOSUB r3 IF r = 4 THEN: GOSUB r4 IF r = 5 THEN: GOSUB r5 IF r = 6 THEN: GOSUB r6 IF r = 7 THEN: GOSUB r7 IF r = 8 THEN: GOSUB r8 IF r = 9 THEN: GOSUB r9 RETURN parser: PRINT "> "; cmd$ = GrabInput cmd$ = LTRIM$(RTRIM$(UCASE$(cmd$))) IF cmd$ = "END" OR cmd$ = "QUIT" OR cmd$ = "EXIT" OR cmd$ = "Q" THEN END END IF IF cmd$ = "HELP" OR cmd$ = "H" OR cmd$ = "?" THEN CLS PRINT "HERE ARE SOME BASIC COMMANDS THAT CAN BE USED IN THE GAME..." PRINT PRINT "NORTH, EAST ,SOUTH, AND WEST - MOVE TO AN AVAILABLE LOCATION" PRINT "EXAMINE (OBJECT) - EXAMINE AN OBJECT" PRINT "USE (OBJECT) - USE AN OBJECT" PRINT "TAKE (OBJECT) - TAKE OR MOVE AN OBJECT" PRINT "INVENTORY - VIEW YOUR INVENTORY" PRINT "DRINK - DRINK BEER" PRINT "UNLOCK - UNLOCK DOOR" PRINT "HELP - VIEW THIS SCREEN" PRINT "END - END GAME" PRINT PRINT "PRESS ANY KEY...": SLEEP DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "INVENTORY" OR cmd$ = "INV" OR cmd$ = "ITEMS" OR cmd$ = "I" THEN CLS PRINT "INVENTORY..." PRINT IF gotkey = 1 THEN: PRINT "The key to your car. A 1999 rust red sedan." PRINT PRINT "PRESS ANY KEY..." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "GO NORTH" OR cmd$ = "NORTH" OR cmd$ = "N" THEN IF r = 3 THEN: r = 2: GOTO moved IF r = 9 THEN: r = 8: GOTO moved IF r = 7 THEN: r = 6: GOTO moved IF r = 6 THEN: r = 5: GOTO moved END IF IF cmd$ = "GO EAST" OR cmd$ = "EAST" OR cmd$ = "E" THEN IF r = 1 THEN: r = 2: GOTO moved IF r = 3 THEN: r = 4: GOTO moved IF r = 4 THEN: r = 5: GOTO moved IF r = 8 THEN: r = 6: GOTO moved END IF IF cmd$ = "GO SOUTH" OR cmd$ = "SOUTH" OR cmd$ = "S" THEN IF r = 2 THEN: r = 3: GOTO moved IF r = 8 THEN: r = 9: GOTO moved IF r = 5 THEN: r = 6: GOTO moved IF r = 6 THEN: r = 7: GOTO moved END IF IF cmd$ = "GO WEST" OR cmd$ = "WEST" OR cmd$ = "W" THEN IF r = 2 THEN: r = 1: GOTO moved IF r = 5 THEN: r = 4: GOTO moved IF r = 4 THEN: r = 3: GOTO moved IF r = 6 THEN: r = 8: GOTO moved END IF IF (cmd$ = "USE KEY") THEN CLS PRINT "You aren't at your car." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE DEMON") AND r = 9 THEN CLS PRINT "The winged beast stands about eight feet tall. It's eye's are" PRINT "a bright red and it's mouth is toothless...strange." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE KEY") AND gotkey = 1 THEN CLS PRINT "An old metal key with the logo of the car brand." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "USE KEY") AND gotkey = 1 AND r = 9 THEN CLS GOTO win: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "RUN") AND r = 9 THEN CLS GOTO lose: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF moved: RETURN r1: PRINT "A cold breeze brushes past you. On a moonless night and not a" PRINT "star in the sky. Just what lurks in this darkness?" RETURN r2: PRINT "With every step, the echo of your shoes making contact with" PRINT "the street can be heard." RETURN r3: PRINT "In the distance, you hear a muffed cry, followed by a scream." RETURN r4: PRINT "The lamp posts begin to flicker. In the distance traffic lights" PRINT "can be seen shutting off and turning back on." RETURN r5: PRINT "With your heart racing, you feel the eye's of someone or something" PRINT "watching you." RETURN r6: PRINT "You have entered the parking lot. Though it's empty, you can't" PRINT "seem to find your car." RETURN r7: PRINT "A dead end. Nothing but an empty field and darkness...great." RETURN r8: PRINT "A gust of wind with the force of storm almost knocks you down. Just" PRINT "what was that?" RETURN r9: PRINT "There you see your car. A sigh of relief is washed over your body." PRINT "But then...falling from the heavens like a mighty angel of sorts." PRINT "Stands before you, a demon...just what is it?" RETURN win: COLOR 2, 0 CLS PRINT "You jump in your car and speed away. The mighty creature sores" PRINT "up into the heavens and you think you lost it. A loud scream is" PRINT "heard...it's hot on your track...To be continued." PRINT DO: LOOP UNTIL INKEY$ <> "" END lose: COLOR 2, 0 CLS PRINT "Like that would work! It rips open your flesh and feasts upon" PRINT "the life within your body...pity." DO: LOOP UNTIL INKEY$ <> "" END FUNCTION GrabInput$ x = POS(0) y = CSRLIN maxwidth = _WIDTH - x PCOPY 0, 1 'make a backup copy of the screen DO k = _KEYHIT i$ = INKEY$ LOOP UNTIL k = 0 AND INKEY$ = "" 'clear the keyboard buffer DO _LIMIT 30 PCOPY 1, 0 LOCATE y, x: PRINT Userinput$ k = _KEYHIT SELECT CASE k CASE 8 Userinput$ = LEFT$(Userinput$, LEN(Userinput$) - 1) CASE 65 TO 90, 97 TO 122, 32 Userinput$ = UCASE$(Userinput$ + CHR$(k)) END SELECT timerleft## = (DOOM - TIMER(0.001)) minutes = timerleft## \ 60 seconds = timerleft## - minutes * 60 LOCATE 2, 32: PRINT USING " ###:##.###"; minutes, seconds IF timerleft## <= 0 THEN GOTO doomed _DISPLAY LOOP UNTIL k = 13 GrabInput$ = Userinput$ _AUTODISPLAY EXIT FUNCTION doomed: CLS PRINT "Before you know it, the sun arises and erases the cold" PRINT "dead hands of the night. But alas, you are never seen" PRINT "again. A snack for what lurks in the darkness." _DISPLAY END END SUB